UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LWUBFZluns46xY4xFRh/p/UpuCCbuEGEDQGZf1l6ZNw=' 
WHERE 
  key_id = 'b2adae6a200ffac864059ec9c688003aa219441fe84da8272eb932db3ac96e70' 
  AND (
    token = 'LWUBFZluns46xY4xFRh/p/UpuCCbuEGEDQGZf1l6ZNw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052