UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0pFBGn1uadRgYUPJrqoDLWd1VVcoq6fFzNZqt88IsrM='
WHERE
key_id = '155c6660100db028b2ce7ae66b66f819b9b85a20c4d9fbd4f488dd70e3e06461'
AND (
token = '0pFBGn1uadRgYUPJrqoDLWd1VVcoq6fFzNZqt88IsrM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)