UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vbXmhEs2FTSmyW1T7xvObXnduf+A3HorIy6ahC7WqlE='
WHERE
key_id = '7699b74d72bb231f4e00292d08707d4b2920ad789e05ce84030755fd1ac71a28'
AND (
token = 'vbXmhEs2FTSmyW1T7xvObXnduf+A3HorIy6ahC7WqlE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)