UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yDXLlID5yLAhhVdAdpddD1S2lLbog0sXvsUPUZV2/I4='
WHERE
key_id = 'c08f4faa69bb61cd01a7a56faf0df6fcd81ed8325e4ccf528fd1bbadc614e21e'
AND (
token = 'yDXLlID5yLAhhVdAdpddD1S2lLbog0sXvsUPUZV2/I4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)