UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w1NeEFoSZua9hqvHNBxIAKf48AeDjllbwCTkdCctBL4=' 
WHERE 
  key_id = 'c2fd73237682630ebe2c8cd2e381615599564616a5fee9638843ef88f47b2860' 
  AND (
    token = 'w1NeEFoSZua9hqvHNBxIAKf48AeDjllbwCTkdCctBL4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018