UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L5CZTy05UyjiesZPSDFz/1AZXZDrum9GAykvWD7jgHQ='
WHERE
key_id = '1d4aa33f96be27c7c10f9a955cbc7fd21cdce87c695a1c0010f50d243e3bb0eb'
AND (
token = 'L5CZTy05UyjiesZPSDFz/1AZXZDrum9GAykvWD7jgHQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)