UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'okp+YgwhK4k9IweL9yMA62n4Mn3YKpTjHYwgfoF/pEI='
WHERE
key_id = 'bcfd6aca29bdd7a10ba0ebac5c54cb50f1368bfd97e6f011c781a3e11e3cbd7d'
AND (
token = 'okp+YgwhK4k9IweL9yMA62n4Mn3YKpTjHYwgfoF/pEI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)