UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ekXMkhTrLMPnrFdJ9V3gfBPrahbmXpVVBTbkHtNbShs='
WHERE
key_id = '00f4171b6c53f0482a0f0ae59697f16e1d91a4ec5ecaf77a46f6363da1619fcb'
AND (
token = 'ekXMkhTrLMPnrFdJ9V3gfBPrahbmXpVVBTbkHtNbShs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)