UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V/NQ3H5szclVfrKnT90jXFTD7LspUNlmTgjmtWbQoJM='
WHERE
key_id = 'a4fdb82c2943dafc6a50d98cb3675918cbf18a6492ef9962a620fb69d1f7fc72'
AND (
token = 'V/NQ3H5szclVfrKnT90jXFTD7LspUNlmTgjmtWbQoJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)