UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MEP+vHj0QYYl7eUhmmOExBFNcwOQbsm0hU38jUocP3M=' 
WHERE 
  key_id = '5b6495029e1c47030d8bfecc4d9f7431136a4722512c3a8465b85e5a89eb7383' 
  AND (
    token = 'MEP+vHj0QYYl7eUhmmOExBFNcwOQbsm0hU38jUocP3M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045