UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vrxoyOZ6Iu0MmEdoPgrEnxXnl7yLg4De4EMsG9mDPGE='
WHERE
key_id = 'd5f1d64293625bcf7f4d50b4eea50fe929ab9d002b66f02a541bfe4d783dc3b9'
AND (
token = 'vrxoyOZ6Iu0MmEdoPgrEnxXnl7yLg4De4EMsG9mDPGE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)