UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hYqhwBa/ib6u2lfR1VTZXRvPKoLU/jCd5JWgSKWHh0Y='
WHERE
key_id = 'f1cec5050ca4516c163df9e1c7937980701ef8843aed3d9ea50e1a706e03c703'
AND (
token = 'hYqhwBa/ib6u2lfR1VTZXRvPKoLU/jCd5JWgSKWHh0Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)