UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JKPEEQPOpvPGnJ/RC0CAobKxVWP1O7mrydpgD8GZCjo='
WHERE
key_id = '6b1f2ecbace8d917b28dae3e68417d43809c34a23c6164e8c00ece57f1329af8'
AND (
token = 'JKPEEQPOpvPGnJ/RC0CAobKxVWP1O7mrydpgD8GZCjo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)