UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '28ggTfePVFKShp6UTrIuoHW00vgRW86hXnpViPmdKHE='
WHERE
key_id = 'e8dba95388eace74b3bc8284a34d74f3a94a1a55132c2c644a02ea8db70633f1'
AND (
token = '28ggTfePVFKShp6UTrIuoHW00vgRW86hXnpViPmdKHE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)