UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GsRqJ3OUlsl0tUtYcy3ilLZ54bE4qm6+nPUT9CXJ9iI=' 
WHERE 
  key_id = '057f4b5eea7e0d75c3ba55009fbdf5bdb7cd6466a2571141b024c718aac64d24' 
  AND (
    token = 'GsRqJ3OUlsl0tUtYcy3ilLZ54bE4qm6+nPUT9CXJ9iI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035