UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0LlGi2Y7CcM/b3m9Ixzhw3FfaIkXvctzIHMBrftby5w='
WHERE
key_id = 'dd5e9b565f5b0c0ff4be63868684c0a0349bc226b0d954c63ded16d93de26ad4'
AND (
token = '0LlGi2Y7CcM/b3m9Ixzhw3FfaIkXvctzIHMBrftby5w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)