UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zvZJ2YsimRCcFrWugLj859S9YufamS+ddWYJ0EOgVpc='
WHERE
key_id = 'afac43b4a8dab7fc467d77d04bf31c4a7ad6906ca8746b69953e9854836edf20'
AND (
token = 'zvZJ2YsimRCcFrWugLj859S9YufamS+ddWYJ0EOgVpc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)