UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5mR61c3FBSAGEKjFFfcNAnhR+Vk2c/he67ssk8XK8Nk=' 
WHERE 
  key_id = '5abc59a21267388df255bd0fce06d7c4927ba83021e984217ff6f850bde144d4' 
  AND (
    token = '5mR61c3FBSAGEKjFFfcNAnhR+Vk2c/he67ssk8XK8Nk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031