UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YU5BIGRDzjbagVx8zyTT/uJSQNKqcezV0E/dJVwFnqo=' 
WHERE 
  key_id = '0cfbe7244f7f5db6e6f87b09bbcd9a8cba4a137353c79b31bc96711a918642da' 
  AND (
    token = 'YU5BIGRDzjbagVx8zyTT/uJSQNKqcezV0E/dJVwFnqo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048