UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TjbF5l/yt1HBsQLp8E4WfHbJW6so0AN/4Piek3KaVWc='
WHERE
key_id = '84d7230621f2275cec9b86b31bbdef1d08251f110f92c6c0a75951da7517a2b9'
AND (
token = 'TjbF5l/yt1HBsQLp8E4WfHbJW6so0AN/4Piek3KaVWc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)