UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1x6tY73AWygRhnqO9LlrC10MYM+ZatXmHBjcON6XIBY='
WHERE
key_id = 'ff095f3f110a6448dc3e7082d56018385ea43a777f0fa9aec11b622bab4b651c'
AND (
token = '1x6tY73AWygRhnqO9LlrC10MYM+ZatXmHBjcON6XIBY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)