UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xRjc2vLVDRAN/YUcHv6jU/ZjEYoh/dX7o93cjs0UIr0='
WHERE
key_id = '72f1ca94471d5442743369ccde43aceebbe08d1a681db9dcda32a2a5be2ed5a3'
AND (
token = 'xRjc2vLVDRAN/YUcHv6jU/ZjEYoh/dX7o93cjs0UIr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)