UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8RUqTI5rM4d1G7VeEmxtFUg7OjDiRLnSf3lvLxcmpTs=' 
WHERE 
  key_id = '8e93881edf05e79c878bac7eda55d5113f24c998adbc0544f4996a04e57c3667' 
  AND (
    token = '8RUqTI5rM4d1G7VeEmxtFUg7OjDiRLnSf3lvLxcmpTs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031