UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7yjLjZWhNysrYWteczgKIeo/VHlaFQYo2sDZTyFHndE=' 
WHERE 
  key_id = 'e25ec8f56c536889d05365da3062dc6c858b48d689ddc27daaed7f288c359f61' 
  AND (
    token = '7yjLjZWhNysrYWteczgKIeo/VHlaFQYo2sDZTyFHndE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030