UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'inzndfVD5+SpjLqSb6zuHw7KJV2c1X9fX2hfTFRvCUI=' 
WHERE 
  key_id = 'e84243f576e6d3f75b7c0e026e83922849ae535ebf3625de5e7dd2ebdad1f489' 
  AND (
    token = 'inzndfVD5+SpjLqSb6zuHw7KJV2c1X9fX2hfTFRvCUI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051