UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'alCClbIFfSuu9opeRPRKmInfbohaJvqAj8jY5abrfrI=' 
WHERE 
  key_id = '42442a25414a194bb6a0cb0dcc80bdf88a2a5fd6e7c3d8993634d9c8f1eb3e86' 
  AND (
    token = 'alCClbIFfSuu9opeRPRKmInfbohaJvqAj8jY5abrfrI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019