UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd1OmRtCkWqgBbPyUchIkuSihyolJpKMlNrsMHJFQdTc='
WHERE
key_id = '690c49e588171dcb37b9f09f8258203261f42d928121ddd3f6a8222629030837'
AND (
token = 'd1OmRtCkWqgBbPyUchIkuSihyolJpKMlNrsMHJFQdTc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)