UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0FvXDlE67/yYDscNeLO52mrhD9/L4SO9h7P0Cb/V6v8=' 
WHERE 
  key_id = 'dfe21d0bdb3f3ed95994c4d91f819867f198d95cf48915e423e17699664d05f0' 
  AND (
    token = '0FvXDlE67/yYDscNeLO52mrhD9/L4SO9h7P0Cb/V6v8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032