UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4SRnrEtQkTP28fbP74ntxGaj+2i79I7X7/xF9GVUlPo=' 
WHERE 
  key_id = '1a05adc75b55ece8e6cef2fee13b2a3940898c9eb38a5727edbae1c83459571d' 
  AND (
    token = '4SRnrEtQkTP28fbP74ntxGaj+2i79I7X7/xF9GVUlPo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027