UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ty5f2Twvo7gEkQUVwuqJgaAsYwtcyzWblBDIWUGjCJk='
WHERE
key_id = '41aa86ef7f120bc40a2e999fe2b5a71aab7a5ae7409a64e3fc8fcacc670dfe75'
AND (
token = 'Ty5f2Twvo7gEkQUVwuqJgaAsYwtcyzWblBDIWUGjCJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)