UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pz7ioGqHwA0CUkix6qv9VwV/75Tu5xSBzCXl46UAdVs='
WHERE
key_id = '1509aa8078f0e0580b7121ae20b8edec9ffd87da3eb413b4d71bad9aa6bc5a6b'
AND (
token = 'Pz7ioGqHwA0CUkix6qv9VwV/75Tu5xSBzCXl46UAdVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)