UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'chRjDMGgMO+FLYCNdSr/lgnFgb6o/8rPfUOg+OwRyiI='
WHERE
key_id = '019529d47103e3de9b8b05a5628b9328e7b73b5f02b4e0080c867201c479970a'
AND (
token = 'chRjDMGgMO+FLYCNdSr/lgnFgb6o/8rPfUOg+OwRyiI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)