UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3R5Sq/unYG1QATA62CK7s3omKVKQXuQOQFEJN2PUS5Q='
WHERE
key_id = '5e12944b3e66c7d85ea1a8c1c553b14fa29230a7a70abfafc9ed2608b4b7ee58'
AND (
token = '3R5Sq/unYG1QATA62CK7s3omKVKQXuQOQFEJN2PUS5Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)