UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uD33hlILmYHZ/fVb1Ton3WU7s8x+oVQcIy67uCp8il4='
WHERE
key_id = 'f757f2f811fb36c64015e42bb419bd08a0f3c92abef652f1c336c4402e3c5c85'
AND (
token = 'uD33hlILmYHZ/fVb1Ton3WU7s8x+oVQcIy67uCp8il4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)